<template>
  <p>这是Product页面</p>
</template>

<script>
export default {
    watch:{
        $route(newVal, oldVal) {
            console.log('newVal',newVal);
            console.log('oldVal',oldVal);
        }
    },
    methods:{
        init(){
            console.log("初始化数据,请求后台数据");
        }
    },
    mounted(){
        this.init()
        console.log("组件生命周期触发了");
        console.log(this.$route.params);
    }
}
</script>